void Print_Factorial(const int N)
{
	if (N < 0)
	{
		printf("Invalid input\n");
	}
	else
	{
		int i;

		int num[2600];
		memset(num, -1, sizeof(num));
		num[0] = 1;

		for (i = 1; i <= N; i++)
		{
			int j;

			//临时存储num[]
			j = 0;
			int numTmp[2600] = { 0 };
			while (num[j] != -1)
			{
				numTmp[j] = num[j];
				j++;
			}

			//m乘以n等于m个n相加，共加m-1次
			for (j = 1; j < i; j++)
			{
				//加法操作
				int k = 0;
				while (num[k] != -1)
				{
					int carryFlg = 0;
					num[k] += numTmp[k];
					if (num[k] > 9)
					{
						carryFlg = num[k] / 10;
						num[k] %= 10;
					}

					//进位操作
					if (carryFlg)
					{
						if (num[k + 1] == -1)
						{
							num[k + 1] = 1;
						}
						else
						{
							num[k + 1]++;
						}
					}
					k++;
				}
			}
		}

		//倒转输出num[]
		i = 0;
		while (num[i] != -1)
		{
			i++;
		}
		for (i--; i > -1; i--)
		{
			printf("%d", num[i]);
		}
		printf("\n");

		/*
		//数字不超过2^64-1=18446744073709551615（共20位）时使用，最多能计算20!
		unsigned long long factorial = 1ULL;
		for (int i = 1; i <= N; i++)
		{
			factorial *= i;
		}
		printf("%lld", factorial);
		*/
	}
}